/** @type {import('jest').Config} */
module.exports = {
  testEnvironment: "jsdom",
  transform: {
    "^.+\\.vue$": "@vue/vue3-jest",
    "^.+\\.(js|jsx|mjs|cjs)$": "babel-jest",
    "^.+\\.(ts|tsx)$": "ts-jest"
  },
  moduleFileExtensions: ["vue", "js", "jsx", "json", "ts", "tsx"],
  moduleNameMapper: {
    "^@/(.*)$": "<rootDir>/src/$1",
    "\\.(css|less|scss|sass)$": "identity-obj-proxy"
  },
  testMatch: ["**/test/unit/**/*.spec.[jt]s?(x)", "**/test/integration/**/*.spec.[jt]s?(x)", "**/test/e2e/**/*.spec.[jt]s?(x)"],
  testEnvironmentOptions: {
    customExportConditions: ["node", "node-addons"]
  },
  transformIgnorePatterns: ["/node_modules/(?!@vue)"],
  collectCoverage: true,
  collectCoverageFrom: ["src/**/*.{js,vue}", "!src/main.js", "!src/router/index.js", "!**/node_modules/**"],
  coverageReporters: ["text", "lcov", "json"],
  setupFilesAfterEnv: ["<rootDir>/test/setup.js"]
};
